"use strict";

/**
 * @auther wtfssd
 * Created by wtfssd on 2017/11/2
 */
import * as React from 'react'
import {commonStyles} from "../assets/styles/common";
import {commentStyles} from "../assets/styles/guide";
import Avatar from "./Avatar";
import MyText from "./MyText";
import Line from "./Line";
import {PraiseItemProps} from "./index";
import Colors from "../assets/styles/Colors";
import Request from "../utils/Request";

const {View} = require('react-native');
const {connect} = require('react-redux');

class PraiseItem extends React.Component<PraiseItemProps, any> {
    // static defaultProps = {
    //     nameColor:'#333',
    //     subColor:'#333',
    // };
    render() {
        return (
            <View style={[{backgroundColor: '#fff'}, this.props.style]}>
                <View style={[commonStyles.listItem, commentStyles.item, commonStyles.relative]}>
                    <Avatar source={{uri:Request.checkImageUrl(this.props.item.avatar)}}/>
                    <View style={[commonStyles.flexColumn, commentStyles.leftContent]}>
                        <MyText numberOfLines={1} style={commentStyles.name}
                                color={Colors.Title}>{this.props.item.userName || ''}</MyText>
                        <MyText numberOfLines={2} style={commentStyles.sub}
                                color={Colors.Title}>{this.props.item.companyName || ''}</MyText>
                    </View>
                </View>
                <Line/>
            </View>
        );
    }
}


export default PraiseItem;